package architect.design.patterns.creation.builder.modern;

/**
 * 现代构建者模式
 *
 * @author guanxin
 * @date 2018/5/4 15:45
 */

public class ModernBuilderCase {

    public static void main(String[] args) {
        User user1 = new User.UserBuilder("william", "Yang")
                .age(35)
                .phone("123456")
                .address("Fake address 1234")
                .build();

        System.out.println(user1);

        User user2 = new User.UserBuilder("Jack", "Liu")
                .age(40)
                .phone("5655")
                //no address
                .build();

        System.out.println(user2);

        User user3 = new User.UserBuilder("Frank", "Han")
                //no age
                //no phone
                //no address
                .build();

        System.out.println(user3);
    }
}
